"""道长"""

import pytest
#fixture作用域class
@pytest.fixture(scope='class')
def login():
    print("scope为class")



class TestLogin():

    def test_01(self):
        print("用例1")

    #传入logoutfixture
    def test_02(self,login):
        print("用例2")

    def test_03(self,login):
        print("用例3")

    def test_04(self):
        print("用例4")

if __name__ == '__main__':
    pytest.main()
"""
test11.py::TestLogin::test_01 PASSED                                     [ 25%]用例1

test11.py::TestLogin::test_02 scope为class
PASSED                                     [ 50%]用例2

test11.py::TestLogin::test_03 PASSED                                     [ 75%]用例3

test11.py::TestLogin::test_04 PASSED                                     [100%]用例4
"""